package com.kgc.skProvider.service.serviceimpl;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.collection.pojo.CwOtherIncomePayname;
import com.kgc.collection.pojo.PaymentMethod;
import com.kgc.skProvider.dao.PaymentMethodMapper;
import com.kgc.skProvider.service.PaymentMethodService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PaymentMethodServiceImpl implements PaymentMethodService {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private PaymentMethodMapper paymentMethodMapper;


    @Override
    public ResponseMsg selectPaymentMethod() {
        logger.info("PaymentMethodServiceImpl selectPaymentMethod is start");
        ResponseMsg responseMsg = new ResponseMsg();
        List<PaymentMethod> paymentMethods = paymentMethodMapper.selectPaymentMethod();
        responseMsg.setData(paymentMethods);
        logger.debug("PaymentMethodServiceImpl selectPaymentMethod is end return are{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg selectCwOtherIncomePayname() {
        logger.info("PaymentMethodServiceImpl selectCwOtherIncomePayname is start");
        ResponseMsg responseMsg = new ResponseMsg();
        List<CwOtherIncomePayname> list=paymentMethodMapper.selectCwOtherIncomePayname();
        responseMsg.setData(list);
        logger.debug("PaymentMethodServiceImpl selectCwOtherIncomePayname is end return are{}",responseMsg);
        return responseMsg;
    }
}
